﻿using System;
using System.Collections.Generic;

class CounterMethod
{
    static int AppearanceCounter(int[] array, int number)
    {
        int counter = 0;
        for (int i = 0; i < array.Length; i++)
        {
            if (array[i] == number)
            {
                counter++;
            }
        }
        return counter;
    }
    static void Main()
    {
        Console.WriteLine("How many elements you want to have in the array:");
        int dimention = int.Parse(Console.ReadLine());
        int[] intArray = new int[dimention];
        for (int index = 0; index < dimention; index++)
        {
            Console.WriteLine("Enter element {0}:", index);
            intArray[index] = int.Parse(Console.ReadLine());
        }
        Console.WriteLine("The array you entered is:");
        for (int i = 0; i < dimention; i++)
        {
            Console.WriteLine(intArray[i]);
            Console.WriteLine();
        }
        Console.WriteLine("Enter the number you are looking for:");
        int numberSearched = int.Parse(Console.ReadLine());
        Console.WriteLine("The number appears {0} times in the array!",AppearanceCounter(intArray,numberSearched));
    }
}

